Integration
Adapted from Wolfram.com documentation
The Wolfram Language knows how to do almost any integral that can be done in terms of standard mathematical functions. But you should realize that even though an integrand may contain only fairly simple functions, its integral may involve much more complicated functions—or may not be expressible at all in terms of standard mathematical functions.
Download original notebookTake an integral
Use command palette Special Characters toolbox to enter integral or type it directly
Integrate[u[x], x]
(*TB[*)Integrate[(*|*)u[x](*|*), (*|*)x(*|*)](*|*)(*1:eJxTTMoPSmNmYGAo5gUSYZmp5S6pyflFiSX5RcGcQBHPvJLUdCA3NZMRpIgVSLgl5hSnAgCQTg44*)(*]TB*)
You can take derivative of it as normal
D[(*TB[*)Integrate[(*|*)u[x](*|*), (*|*)x(*|*)](*|*)(*1:eJxTTMoPSmNmYGAo5gUSYZmp5S6pyflFiSX5RcGcQBHPvJLUdCA3NZMRpIgVSLgl5hSnAgCQTg44*)(*]TB*), x]
u[x]
Take an integral of a defined function
(*TB[*)Integrate[(*|*)Log[x](*|*), (*|*)x(*|*)](*|*)(*1:eJxTTMoPSmNmYGAo5gUSYZmp5S6pyflFiSX5RcGcQBHPvJLUdCA3NZMRpIgVSLgl5hSnAgCQTg44*)(*]TB*)
-x+x Log[x]
Define the boundaries
Integrate[Sin[x], {x, A, B}]
Cos[A]-Cos[B]
More complicated example
Integrate[(*SpB[*)Power[(1 - (*SpB[*)Power[x(*|*),(*|*)2](*]SpB*))(*|*),(*|*)g](*]SpB*), x]
x Hypergeometric2F1[(*FB[*)((1)(*,*)/(*,*)(2))(*]FB*),-g,(*FB[*)((3)(*,*)/(*,*)(2))(*]FB*),(*SpB[*)Power[x(*|*),(*|*)2](*]SpB*)]
Hybrid approach
Integrals like this can systematically be done using Piecewise
Integrate[(*SpB[*)Power[2(*|*),(*|*)Max[x, 1 - x]](*]SpB*), x]
(*TB[*)Piecewise[{{(*|*)-(*FB[*)(((*SpB[*)Power[2(*|*),(*|*)1-x](*]SpB*))(*,*)/(*,*)(Log[2]))(*]FB*)(*|*),(*|*)x<=(*FB[*)((1)(*,*)/(*,*)(2))(*]FB*)(*|*)},{(*|*)-(*FB[*)((2 ((*SqB[*)Sqrt[2](*]SqB*)))(*,*)/(*,*)(Log[2]))(*]FB*)+(*FB[*)(((*SpB[*)Power[2(*|*),(*|*)x](*]SpB*))(*,*)/(*,*)(Log[2]))(*]FB*)(*|*),(*|*)True(*|*)}}](*|*)(*1:eJxTTMoPSmNiYGAo5gUSYZmp5S6pyflFiSX5RcGcQJGAzNTk1PLM4tRMkCIAD2QL0A==*)(*]TB*)
You can give explicit assumptions inside Integrate
Integrate[Sin[x] BesselJ[0, a x]/x, {x, 0, Infinity}, Assumptions -> Im[a] == 0]
((*FB[*)((1)(*,*)/(*,*)(2))(*]FB*)) ((*SqB[*)Sqrt[\[Pi]](*]SqB*)) ((*TB[*)Piecewise[{{(*|*)(*FB[*)((2 a ArcSin[(*FB[*)((1)(*,*)/(*,*)(a))(*]FB*)])(*,*)/(*,*)(((*SqB[*)Sqrt[\[Pi]](*]SqB*)) Abs[a]))(*]FB*)(*|*),(*|*)(*FB[*)((1)(*,*)/(*,*)((*SpB[*)Power[a(*|*),(*|*)2](*]SpB*)))(*]FB*)<1(*|*)},{(*|*)(*SqB[*)Sqrt[\[Pi]](*]SqB*)(*|*),(*|*)(*FB[*)((1)(*,*)/(*,*)((*SpB[*)Power[a(*|*),(*|*)2](*]SpB*)))(*]FB*)>1(*|*)},{(*|*)0(*|*),(*|*)True(*|*)}}](*|*)(*1:eJxTTMoPSmNiYGAo5gUSYZmp5S6pyflFiSX5RcGcQJGAzNTk1PLM4tRMZiAPAA9oC9E=*)(*]TB*))
Here is a plot of the resulting function of :
Plot[Evaluate[%], {a, -5, 5}]
(*VB[*)(FrontEndRef["34ad5b97-1592-4235-be75-6d942905d424"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKG5skppgmWZrrGppaGumaGBmb6ialmpvqmqVYmhhZGpimmBiZAAB3SxS9"*)(*]VB*)
Geometry of Integrals
The integral of a piecewise-constant function is the sum of the signed areas of the rectangles defined by its plot:
ClearAll[f,x] f[x_] := Piecewise[{ {0, x < 0}, {1, 0 <= x < 1}, {-2, 1 <= x < 3}, {5, 3 <= x} }]
(*TB[*)Integrate[(*|*)f[x](*|*), {(*|*)x(*|*),(*|*)0(*|*),(*|*)4(*|*)}](*|*)(*1:eJxTTMoPSmNiYGAo5gESnnklqelFiSWpTvkVmYwgURYgEVJUmgoAvmMJeQ==*)(*]TB*)
2
Visualize
Plot[f[x], {x,0,4}, Filling->Axis]
(*VB[*)(FrontEndRef["4904b16f-e9b5-4364-81a9-23ff17401969"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKm1gamCQZmqXpplommeqaGJuZ6FoYJlrqGhmnpRmamxgYWppZAgB3lxTC"*)(*]VB*)
Find the surface area of the plot
f[x_, y_] := (*SpB[*)Power[x(*|*),(*|*)2](*]SpB*) + (*SpB[*)Power[y(*|*),(*|*)2](*]SpB*) Plot3D[f[x,y], {x,0,1}, {y,0,1}, BoxRatios->{1,1,1}, Axes->True]
(*VB[*)(FrontEndRef["dc8f2638-94e3-4d7d-b407-f00216a036b6"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKpyRbpBmZGVvoWpqkGuuapJin6CaZGJjrphkYGBmaJRoYmyWZAQCC+RVB"*)(*]VB*)
Apply the formula for infinitesimal surface area of a plot:
dA = Sqrt[1 + (*SpB[*)Power[D[f[x, y], x](*|*),(*|*)2](*]SpB*) + (*SpB[*)Power[D[f[x, y], y](*|*),(*|*)2](*]SpB*) ] // Simplify
(*SqB[*)Sqrt[1+4 ((*SpB[*)Power[x(*|*),(*|*)2](*]SpB*))+4 ((*SpB[*)Power[y(*|*),(*|*)2](*]SpB*))](*]SqB*)
Integrate to find the arc length:
Integrate[dA, {x, 0, 1}, {y, 0, 1}] % // N
((*FB[*)((1)(*,*)/(*,*)(24))(*]FB*)) (24-6 ArcCot[2]+ArcTan[(*FB[*)((4)(*,*)/(*,*)(3))(*]FB*)]+14 Log[5])
1.8615641807530907`
Compare with the answer returned by Area:
Area[f[x, y], {x, 0, 1}, {y, 0, 1}] % // N
((*FB[*)((1)(*,*)/(*,*)(24))(*]FB*)) (24-6 ArcCot[2]+ArcTan[(*FB[*)((4)(*,*)/(*,*)(3))(*]FB*)]+14 Log[5])
1.8615641807530907`
Interactive Example
Consider Gabriel's horn, the interior
ClearAll[f, v, s, a] f[x_] := 1/x
Compute the volume for arbitrary endpoint :
v[a_] = Integrate[\[Pi] (*SpB[*)Power[f[x](*|*),(*|*)2](*]SpB*), {x, 1, a}, Assumptions -> a > 1]
(*FB[*)(((-1+a) \[Pi])(*,*)/(*,*)(a))(*]FB*)
Compute the surface area for arbitrary endpoint :
s[a_] = Integrate[2 \[Pi] f[x] Sqrt[1 + (*SpB[*)Power[D[f[x], x](*|*),(*|*)2](*]SpB*)], {x, 1, a}, Assumptions -> a > 1]
\[Pi] ((*SqB[*)Sqrt[2](*]SqB*)-(*SqB[*)Sqrt[1+(*FB[*)((1)(*,*)/(*,*)((*SpB[*)Power[a(*|*),(*|*)4](*]SpB*)))(*]FB*)](*]SqB*)-ArcSinh[1]+ArcSinh[(*SpB[*)Power[a(*|*),(*|*)2](*]SpB*)])
Visualize the horn along with its volume and surface area as functions
Manipulate[ Row[{ RevolutionPlot3D[1/s, {s, 1, b}, RevolutionAxis -> {1, 0, 0}, PlotRange -> {{1, 15}, {-1, 1}, {-1, 1}}, Mesh -> None, ImageSize -> 300, Boxed -> False ], Plot[{s[x], v[x]}//Evaluate, {x, 1, 16}, ImageSize -> 300, PlotLegends -> {"Surface Area = "<>ToString[SetPrecision[s[b], 2]], "Volume = "<>ToString[SetPrecision[v[b],2]]}, Epilog->{Orange, PointSize[Large], Point[{b, v[b] // N}], Blue, Point[{b, s[b] // N}]} ] }] // Quiet, {{b, 5., "a"}, 5., 15, 5.0}]
(*GB[*){{(*VB[*)(EventObject[<|"Id" -> "a342322a-f554-4cae-8a77-9d26f467e624", "Initial" -> {5.}, "View" -> "71667ce6-3f82-4b2d-b9d3-fae88c121b2a"|>])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKmxuamZknp5rpGqdZGOmaJBml6CZZphjrpiWmWlgkGxoZJhklAgCCohXV"*)(*]VB*)}(*||*),(*||*){(*VB[*)(FrontEndRef["572a4c41-618f-4472-968a-a86a58367c6d"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKm5obJZokmxjqmhlapOmamJgb6VqaWSTqJlqYJZpaGJuZJ5ulAABz2xT2"*)(*]VB*)}}(*]GB*)
Laplace Transforms
Here is a simple Laplace transform:
ClearAll[t,s]; LaplaceTransform[(*SpB[*)Power[t(*|*),(*|*)4](*]SpB*) Sin[t], t, s]
(*FB[*)((24 (1-10 ((*SpB[*)Power[s(*|*),(*|*)2](*]SpB*))+5 ((*SpB[*)Power[s(*|*),(*|*)4](*]SpB*))))(*,*)/(*,*)((*SpB[*)Power[(1+(*SpB[*)Power[s(*|*),(*|*)2](*]SpB*))(*|*),(*|*)5](*]SpB*)))(*]FB*)
Here is the inverse:
InverseLaplaceTransform[%, s, t]
((*SpB[*)Power[t(*|*),(*|*)4](*]SpB*)) Sin[t]
Fourier Transforms
Integral transforms can produce results that involve "generalized functions"
FourierTransform[(*FB[*)((1)(*,*)/(*,*)((1 + (*SpB[*)Power[t(*|*),(*|*)4](*]SpB*))))(*]FB*), t, \[Omega]]
((*FB[*)((1)(*,*)/(*,*)(4))(*]FB*)+(*FB[*)((I)(*,*)/(*,*)(4))(*]FB*)) ((*SpB[*)Power[E(*|*),(*|*)-(*FB[*)(((1+I) \[Omega])(*,*)/(*,*)((*SqB[*)Sqrt[2](*]SqB*)))(*]FB*)](*]SpB*)) ((*SqB[*)Sqrt[\[Pi]](*]SqB*)) (((*SpB[*)Power[E(*|*),(*|*)((*SqB[*)Sqrt[2](*]SqB*)) \[Omega]](*]SpB*)) (-I+(*SpB[*)Power[E(*|*),(*|*)I ((*SqB[*)Sqrt[2](*]SqB*)) \[Omega]](*]SpB*)) HeavisideTheta[-\[Omega]]+(1-I ((*SpB[*)Power[E(*|*),(*|*)I ((*SqB[*)Sqrt[2](*]SqB*)) \[Omega]](*]SpB*))) HeavisideTheta[\[Omega]])